package com.yq.design.memento;

/**
 * @ClassName Client
 * @Description TODO
 * @Author yaoqiang
 * @Date 2021/8/30 11:03
 * @Version 1.0
 */
public class Client {
    public static void main(String[] args) {
        Originator originator = new Originator();
        CareTaker careTaker = new CareTaker();

        originator.setState("1");
        careTaker.addList(originator.saveState());
        originator.setState("2");
        careTaker.addList(originator.saveState());
        System.out.println(originator.getState());
        originator.getStateFromMemontoList(careTaker.get(0));
        System.out.println(originator.getState());
    }
}
